#!/bin/sh -e

DATE=$1
DIR=libtritonus-java-$DATE
TAR=../libtritonus-java_$DATE.orig.tar.gz
CVSROOT=:pserver:anonymous@tritonus.cvs.sourceforge.net:/cvsroot/tritonus

if ! fgrep -q tritonus ~/.cvspass; then
  cvs -d$CVSROOT login
fi
cvs -z9 -d$CVSROOT export -D $DATE -d $DIR tritonus
tar -c -z -f $TAR $DIR
rm -rf $DIR

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
  . .svn/deb-layout
  mv $TAR $origDir
  echo "moved $TAR to $origDir"
fi

